<%--
    Document   : elearning
    Created on : Apr 26, 2012, 12:06:38 PM
    Author     : Khin
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>CMS-FPT Aptech</title>
        <meta name="keywords" content="free css templates, web design, 2-column, html css" />
        <meta name="description" content="Web Design is a 2-column website template (HTML/CSS) provided by templatemo.com" />
        <link href="templatemo_style.css" rel="stylesheet" type="text/css" />
        <!--////// CHOOSE ONE OF THE 3 PIROBOX STYLES  \\\\\\\-->
        <link href="css_pirobox/white/style.css" media="screen" title="shadow" rel="stylesheet" type="text/css" />
        <!--<link href="css_pirobox/white/style.css" media="screen" title="white" rel="stylesheet" type="text/css" />
        <link href="css_pirobox/black/style.css" media="screen" title="black" rel="stylesheet" type="text/css" />-->
        <!--////// END  \\\\\\\-->

        <!--////// INCLUDE THE JS AND PIROBOX OPTION IN YOUR HEADER  \\\\\\\-->
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/piroBox.1_2.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $().piroBox({
                    my_speed: 600, //animation speed
                    bg_alpha: 0.5, //background opacity
                    radius: 4, //caption rounded corner
                    scrollImage : false, // true == image follows the page, false == image remains in the same open position
                    pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
                    pirobox_prev : 'piro_prev',// Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
                    close_all : '.piro_close',// add class .piro_overlay(with comma)if you want overlay click close piroBox
                    slideShow : 'slideshow', // just delete slideshow between '' if you don't want it.
                    slideSpeed : 4 //slideshow duration in seconds(3 to 6 Recommended)
                });
            });
        </script>
        <link href="tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
        <script type="text/javascript" src="tablecloth/tablecloth.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
        <script>
            function doDelete(){
                return confirm("Do you really want to delete Assignment!!");
            }
        </script>
        <script>
            $(function() {
                $( "#datepicker" ).datepicker();
                $( "#datepickers" ).datepicker();
            });
        </script>
        <script>
            function addDate(){
                date = new Date();
                var month = date.getMonth()+1;
                var day = date.getDate();
                var year = date.getFullYear();

                var currentTime = new Date()
                var hours = currentTime.getHours()
                var minutes = currentTime.getMinutes()
                if (minutes < 10)
                    minutes = "0" + minutes

                if (document.getElementById('current').value == ''){
                    document.getElementById('current').value = ((''+month).length<2 ? '0' : '') + month +  '/' + ((''+day).length<2 ? '0' : '') + day + '/' + year + " " + hours + ":" + minutes;
                }
            }
        </script>
        <script language="JavaScript">
            <!--
            function check() {
                var feed= document.getElementById("up");
                var current = document.getElementById("current");
                var start = document.getElementById("datepicker");
                var end = document.getElementById("datepickers");
                if (feed.value.length == 0) {
                    alert("Please input file!!!!");
                    return false;
                }
                if(start.value.length==0){
                    alert("Choose Start day");
                    return false;
                }

                if(start.value<current.value){
                    alert("Choose wrong or time in start day");
                    return false;
                }

                if(end.value.length==0){
                    alert("Choose End day");
                    return false;
                }

                if(end.value<current.value){
                    alert("Choose wrong or time in end day");
                    return false;
                }

                if(start.value > end.value){
                    alert("End day must be bigger than start day");
                    return false;
                }
                else
                    return true;
            }
            //-->
        </script>
        <script type="text/javascript">
            function xxx(){
                str=document.getElementById('up').value.toUpperCase();
                var i=str.lastIndexOf(".",0);
                ext=str.substring(i, str.length);
            }
        </script>
        <script type="text/javascript">
            function check_file(){
                str=document.getElementById('up').value.toUpperCase();
                var i=str.lastIndexOf(".",str.length);
                ext=str.substring(i+1, str.length).toLowerCase();
                if(ext=="zip"||ext=="doc"||ext=="docx"||ext=="pdf"||ext=="rtf"||ext=="rar"||ext=="odt"){
                    return true;
                }
                else
                    alert("invalid selection file");
                return false;
            }

        </script>
        <!--////// END  \\\\\\\-->
        <%
                    String sess = (String) session.getAttribute("sessuser");

                    if (sess == null) {
                        response.sendRedirect("index.jsp");
                    }

        %>
    </head>
    <body onload="addDate();">

        <div id="templatemo_body_wrapper">
            <div id="templatemo_wrapper">

                <div id="tempaltemo_header">
                    <span id="header_icon"></span>
                    <div id="header_content">
                        <div id="site_title">
                            <a href="" target="_parent"><img src="images/templatemo_logo.png" alt="LOGO" /></a>            </div>
                        <p>CMS - FPT Academy International.</p>

                    </div>
                </div> <!-- end of header -->

                <div id="templatemo_main_top"></div>
                <div id="templatemo_main"><span id="main_top"></span><span id="main_bottom"></span>

                    <div id="templatemo_sidebar">

                        <div id="templatemo_menu">
                            <ul>
                                <li><a href="index.jsp" target="_parent" class="current">Home</a></li>
                                <li><a href="vieclam.jsp" target="_parent">Việc Làm</a></li>
                                <li><a href="fat3.jsp" target="_parent">FAT 3</a></li>
                                <li><a href="tintuc.jsp" target="_parent">Tin Tức</a></li>
                                <li><a href="faq_studentandstaff.jsp" target="_parent">FAQ</a></li>
                                <li><a href="about.jsp" target="_parent">About US</a></li>
                            </ul>
                        </div> <!-- end of templatemo_menu -->

                        <div class="sidebar_box">
                            <div class="sb_title">Course Login</div>
                            <div class="sb_content">
                                <div id="login_form">
                                    <form method="post" action="servletlogin">
                                        <span>Hello:</span>
                                        <label ><%=sess%></label>
                                        <br>
                                        <input type="submit" name="action"  value="Logout" />
                                        <br>
                                        <a href="servletchangepass?id=<%=sess%>" >Change password</a>
                                    </form>
                                </div>
                            </div>
                            <div class="sb_bottom"></div>
                        </div>

                        <div class="sidebar_box">
                            <div class="sb_title">Latest Updates</div>
                            <div class="sb_content">

                                <div class="sb_news_box">
                                    <a href="#">Thời Khóa Biểu - FAT3.</a>
                                    <span>25 April 2012</span>
                                </div>

                                <div class="sb_news_box">
                                    <a href="#">FPT Jetking hỗ trợ 30% học phí cho sinh viên hệ thống FPT.</a>
                                    <span>18 April 2012</span>
                                </div>

                                <a href="#"><strong>View All</strong></a>
                            </div>

                            <div class="sb_bottom"></div>

                        </div>

                        <center>
                            <a href="http://validator.w3.org/check?uri=referer"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" width="88" height="31" vspace="8" border="0" /></a> &nbsp;&nbsp;&nbsp;
                            <a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="border:0;width:88px;height:31px"  src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" vspace="8" border="0" /></a>
                        </center>

                        <div class="cleaner"></div>
                    </div> <!-- end of sidebar -->

                    <div id="templatemo_content">

                        <h1 align="right">File Upload Form</h1>

                        <hr/>

                        <div class="content_box">
                            <fieldset>

                                <legend><h3>Upload File</h3></legend>
                                <c:set var="subid" value="${requestScope.Subid}"></c:set>

                                <FORM id="upload" name="upload" ENCTYPE="multipart/form-data" ACTION="servletupload?id=${subid}" METHOD="POST" onsubmit="return check();">

                                    <INPUT id="up" NAME="f" TYPE="file" accept="application/msword,application/pdf,application/zip,application/vnd.openxmlformats-officedocument.wordprocessingml.document" onchange="check_file()" />
                                    <br>
                                    StartDay:
                                    <input id="datepicker" type="text" name="txtstart"/>
                                    <br>
                                    End Day :
                                    <input id="datepickers" type="text" name="txtend"/>
                                    <br>
                                    <INPUT TYPE="submit" VALUE="Upload File" >
                                    <br>
                                    <input type="hidden" id="current" readonly="true"/>
                                </FORM>

                            </fieldset>
                            <br>
                            <br>
                            <br>
                            <c:set var="info" value="${requestScope.INFOASM}"></c:set>
                            <c:if test="${not empty info}">
                                <ul class="tmo_list">
                                    <table border="1">
                                        <thead>
                                        <th>Assignment</th>
                                        <th>StartDate</th>
                                        <th>EndDate</th>
                                        <th>Description</th>
                                        <th>Download</th>
                                        <th>Mark</th>
                                        </thead>
                                        <tbody>
                                            <c:forEach var="rows" items="${info}">
                                                <tr>
                                                    <td>Assignment ${rows.asmId}</td>
                                                    <td>${rows.startDate}</td>
                                                    <td>${rows.endDate}</td>
                                                    <td>${rows.description}</td>
                                                    <td>
                                                        <a href="${rows.asmFile}">Download</a>
                                                    </td>
                                                    <td>
                                                        <c:url var="mark" value="ServletAsm">
                                                            <c:param name="action" value="Mark"/>
                                                            <c:param name="asmid" value="${rows.asmId}"/>
                                                        </c:url>
                                                        <a href="${mark}" >Mark</a>
                                                    </td>
                                                </tr>
                                            </c:forEach>
                                        </tbody>
                                    </table>
                                </ul>
                            </c:if>
                            <br>
                            <br>
                            <br>


                        </div>
                        <div class="cleaner"></div>
                    </div>

                    <div class="cleaner"></div>
                </div>

                <div id="templatemo_main_bottom">
                </div>

            </div> <!-- end of wrapper -->
        </div>

        <div id="templatemo_footer_wrapper">
            <div id="templatemo_footer">
                Copyright © 2012 Aptech Iboard News. All Rights Reserved.<a href="#"></a> |
                <a href="" target="_parent">Website Templates</a> by <a href="" target="_parent">F5-1009-S1</a>

            </div>
        </div>

    </body>
</html>
